package org.example.kg_back.controller;


import org.example.kg_back.common.result.Result;
import org.example.kg_back.service.imp.WarnSimilarHistoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author Colonnello
 * @Gitee https://gitee.com/niuzhengchao
 * @Date 2021/3/15 10:28
 */

@RestController
@RequestMapping("/api/warnSimilarHistory")
public class WarnSimilarHistoryController {

	@Autowired
	private WarnSimilarHistoryService service;

	/**
	 * 查询相似航班告警
	 * @return
	 */

	@GetMapping("/findWarnSimilarHistory")
	public Result<?> findWarnSimilarHistory(){
		return Result.success(service.findWarnSimilarHistory());
	}

	/**
	 * 根据扇区号查询相似航班告警
	 * @return
	 */

	@GetMapping("/findWarnSimilarOfATC")
	public Result<?> findWarnSimilarOfATC(@RequestParam String sectorName){
		return Result.success(service.findWarnSimilarOfATC(sectorName));
	}

	/**
	 * 根据扇区号查询相似航班告警总数
	 * @return
	 */

	@GetMapping("/findWarnSimilarOfATCCount")
	public Result<?> findWarnSimilarOfATCCount(@RequestParam String sectorName){
		return Result.success(service.findWarnSimilarOfATCCount(sectorName));
	}

}
